package TEST;


import java.util.Scanner;
import java.util.TreeSet;

    public class Test01 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
TreeSet<String> s1 = new TreeSet<String>();//默认字典序
TreeSet<String> s2 = new TreeSet<String>();
String str = sc.nextLine();
String[] s = str.split(" ");
for(int i=0;i<s.length;i++) {
if(s1.size()!=5) {
s1.add(s[i]);
}else if(s2.size()!=5){
s2.add(s[i]);
}else {
              break;
}
}
    s1.addAll(s2);
    for(String ss:s1) {
        System.out.println(ss);
    }
}
    }
